package top.onedream.buildsmallsoftware.controller

import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
import top.onedream.buildsmallsoftware.service.RoleService

@RestController
@RequestMapping("/role")
class RoleController(
    private val roleService: RoleService
) {

    /**
     * 创建角色
     * @param [roleName] 角色名
     * @return [String?]
     */
    @PostMapping("/create")
    fun createRole(
        @RequestParam roleName: String
    ): Long? {
        return roleService.createRole(roleName)
    }
}